When a gtk_widget_queue_allocate() on some widget increases the clip,
widget->parent's clip was not updated. This appraoch naively just
unions widget's new clip with widget->parent's clip.
This of course only works if widget and parent share the same GDK
window. In the cases where they don't we can't do anything and need a
better fix.
Fixes label-text-shadow-changes-modify-clip.ui reftest.
#endif /* G_ENABLE_DEBUG */
priv->clip = *clip;
+
+ while (priv->parent &&
+ _gtk_widget_get_window (widget) == _gtk_widget_get_window (priv->parent))
+ {
+ GtkWidgetPrivate *parent_priv = priv->parent->priv;
+ GdkRectangle union_rect;
+
+ gdk_rectangle_union (&priv->clip,
+ &parent_priv->clip,
+ &union_rect);
+
+ if (gdk_rectangle_equal (&parent_priv->clip, &union_rect))
+ break;
+
+ parent_priv->clip = union_rect;
+ priv = parent_priv;
+ }
}
/*